<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    ul {
      list-style: none;
      display: flex;
    }

    li {
      cursor: pointer;
      margin-right: 10px;
    }

    .active {
      background-color: skyblue;
    }
  </style>
</head>

<body>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.js"></script>
  <div id="box">
    {{content}}
    <hr>
    <img :src="src[index]" alt="">
    <ul @click="btn">
      <!-- <li :class="index===0?'active':''" @click="picqiehuan(0)">这是第1个图片</li>
      <li :class="index===1?'active':''" @click="picqiehuan(1)">这是第2个图片</li>
      <li :class="index===2?'active':''" @click="picqiehuan(2)">这是第3个图片</li>
      <li :class="index===3?'active':''" @click="picqiehuan(3)">这是第4个图片</li>
      <li :class="index===4?'active':''" @click="picqiehuan(4)">这是第5个图片</li>
      <li :class="index===5?'active':''" @click="picqiehuan(5)">这是第6个图片</li>
      <li :class="index===6?'active':''" @click="picqiehuan(6)">这是第7个图片</li>
      <li :class="index===7?'active':''" @click="picqiehuan(7)">这是第8个图片</li> -->

      <li :class="index===0?a:''" @click="picqiehuan(0)">这是第1个图片</li>
      <li :class="index===1?a:''" @click="picqiehuan(1)">这是第2个图片</li>
      <li :class="index===2?a:''" @click="picqiehuan(2)">这是第3个图片</li>
      <li :class="index===3?a:''" @click="picqiehuan(3)">这是第4个图片</li>
      <li :class="index===4?a:''" @click="picqiehuan(4)">这是第5个图片</li>
      <li :class="index===5?a:''" @click="picqiehuan(5)">这是第6个图片</li>
      <li :class="index===6?a:''" @click="picqiehuan(6)">这是第7个图片</li>
      <li :class="index===7?a:''" @click="picqiehuan(7)">这是第8个图片</li>
    </ul>
  </div>
  <script>
    new Vue({
      el: '#box',
      data: {
        content: 'hello Vue',
        src: [
          "./img/10-01.png",
          "./img/10-02.png",
          "./img/11-00.gif",
          "./img/11-01.gif",
          "./img/11-02.gif",
          "./img/11-03.gif",
          "./img/11-04.png",
          "./img/11-05.png",
        ],
        index: 0,
        a: 'active'
      },
      methods: {
        picqiehuan(picnum) {
          this.index = picnum
        },
        btn() {
          console.log(11);
        }
      }

    })
  </script>
  <script>

  </script>
</body>

</html>